package com.upay.android.domain.response;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

public class ResponseError implements Serializable {
	
	/* ---- Constants ---- */
	private static final long serialVersionUID = 201202272149L;
	
	/* ---- Instance Variables ----*/
	
	private Collection<ErrorDetail> errors = new ArrayList<ErrorDetail>();
	private ErrorType type = null;

	
	/* ---- Constructors ---- */
	
	public ResponseError() {
		super();
	}
	
	public ResponseError(ErrorType type) {
		this.type = type;
	}
	
	/* ---- Business Methods ---- */
	
	public void addError(ErrorDetail errorDetail) {
		this.getErrors().add(errorDetail);
	}
	
	/* ---- Getters and Setters ----*/
	
	/**
	 * @return the errors
	 */
	public Collection<ErrorDetail> getErrors() {
		return errors;
	}

	/**
	 * @param errors the errors to set
	 */
	public void setErrors(Collection<ErrorDetail> errors) {
		this.errors = errors;
	}

	/**
	 * @return the type
	 */
	public ErrorType getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(ErrorType type) {
		this.type = type;
	}

}
